import request from '@/utils/request'
// 登录接口
export function loginApi(data) {
  return request({
    url: '/mini/server/user/login',
    method: 'post',
    data
  })
}

// 获取用户信息接口
export function getInfoApi() {
  return request({
    url: '/mini/server/user',
    method: 'get',
  })
}
// 获取通知
export const getNoticeApi = () => {
  return request({
    url: '/mini/common/user/notice',
    method: "POST",
  })
}
// 获取所属租户
export const getTenantIdApi = (phone) => {
  return request({
    url: '/mini/server/user/tenant',
    params: {
      phone
    }
  })
}
// 获取用户信息
export const getUserInfoApi = () => {
  return request({
    url: '/mini/server/user'
  })
}
// 修改密码
export const putPasswordApi = (data) => {
  return request({
    url: `/mini/server/user/pwd`,
    method: 'put',
    data
  })
}
// 修改头像昵称
export const editNameApi = (userId, data) => {
  return request({
    url: `/mini/server/user/${userId}`,
    method: 'post',
    data
  })
}
// 获取头像
export const getPicApi = (id) => {
  return request({
    url: `/mini/server/user/${id}/image`,
  })
}
// 开启租币支付验证码
export const getCodeApi = (data) => {
  return request({
    url: `/mini/server/user/virtual/code`,
    method: 'post', data
  })
}
// 开启租币支付
export const changeTypeApi = (data) => {
  return request({
    url: `/mini/server/user/virtual`,
    method: 'post', data
  })
}
// 获取服务费支付主题
export const isRentPayApi = () => {
  return request({
    url: `/mini/server/user/renterPay`,
  })
}
// 设置服务主题
export const setRentPayApi = (data) => {
  return request({
    url: `/mini/server/user/renterPay`,
    method:'post',
    data
  })
}